<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>后台登录</title>
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />

    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="__STATIC__/css/font.css">
	<link rel="stylesheet" href="__STATIC__/css/xadmin.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script src="__STATIC__/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="__STATIC__/js/xadmin.js"></script>

</head>
<body class="login-bg">
    
    <div class="login layui-anim layui-anim-up">
        <div class="message">聚财国际<span style="font-size: small">中心</span>登录</div>
        <div id="darkbannerwrap"></div>
        
        <form method="post" class="layui-form" action="javascript:;" enctype="multipart/form-data">
           <input name="gname" placeholder="用户名"  type="text" lay-verify="required" class="layui-input" >

            <hr class="hr15">
            <input name="pwd" lay-verify="required" placeholder="密码"  type="password" class="layui-input">
            
			<hr class="hr15">
            <input class="input-text size-L" type="text" placeholder="验证码" lay-verify=""  name="code" value="" style="width:195px;"  >
			<div style="position:absolute;bottom:115px;right:30px;"><img src="{:captcha_src()}" alt="验证码" id="vcode" onclick=" this.src='{:captcha_src()}?'+Math.random();"> </div>

            <hr class="hr15">
            
			 <button  class="layui-btn" lay-filter="check" lay-submit="" style="width:100%;" >
                登录
            </button>
            <hr class="hr20" >
        </form>
    </div>

    <script>
	 layui.use(['form','layer'], function(){
        $ = layui.jquery;
        var form = layui.form
            ,layer = layui.layer;
        //管理员登录
	    form.on('submit(check)', function(data){
			var vcode=document.getElementById('vcode')
            //console.log(data);
            //var url="";
            $.ajax({
                type: "post",
                async:false,
                url: "{:url('admin/login/check')}",
                data: data.field,
                success:function(msg){
					if(msg.code==1){
					  layer.msg(msg.msg,{icon:1,time:1000});
                      setTimeout(function () {
                        window.location.href="{:url('admin/index/index')}";
                      }, 1000);
					
					}
                    else
                    {
						 //console.log(msg);
						layer.msg(msg.msg,{icon:1,time:1000});
                        vcode.src='{:captcha_src()}?'+Math.random();
                      	
					}
				}
        });
  
    });
});   
    </script>

    
    <!-- 底部结束 -->

</body>
</html>